package page
{
	import flash.display.DisplayObjectContainer;
	import flash.display.MovieClip;
	import flash.events.Event;
	
	public class Page_game extends Page
	{
		[Embed( source = "/worldwars.swf.swf", mimeType="application/x-shockwave-flash")]
		private const SWF_GAME:Class;

		private var _state:int;
		private static const STATE_ENTER:int = 0;
		private static const STATE_RUNNING:int = 1;
		private static const STATE_DONE:int = 4;

		private var _game:MovieClip;
		
		public function Page_game(parent:DisplayObjectContainer)
		{
			super(parent);
		}
		
		override protected function onEnterFrame(e:Event):void
		{
			super.onEnterFrame(e);
			
			if(_state == STATE_ENTER)
			{
				_game = new SWF_GAME();
				addChild(_game);
				scaleX = stage.stageWidth / _game.width;
				scaleY = stage.stageHeight / _game.height;
				
				_state = STATE_RUNNING;
			}
			else if(_state == STATE_RUNNING)
			{
				
			}
			else if(_state == STATE_DONE)
			{
			}
			
			//have to do this at last
			if(_state == STATE_DONE)
			{
			}
		}
		
		override public function enter():void
		{
			super.enter();
			_state == STATE_ENTER;
		}
		
		override public function exit():void
		{
			
			//
			super.exit();
		}
	}
}